package org.blogwu.learn.temp;

public class SpringTest2 {
    public static void main(String[] args) {
        String s1 = "Hello";
        String s2 = new StringBuilder("He").append("llo").toString();
        String s3 = s2.intern();
        // Determine which strings are equivalent using the ==
        // operator
        System.out.println("s1 == s2? " + (s1 == s2));
        System.out.println("s1 == s3? " + (s1 == s3));
        System.out.println(isPowerOfTwo(222));
        System.out.println(isPowerOfTwo(6));
        System.out.println(isPowerOfTwo(5));
    }


    private static boolean isPowerOfTwo(int val) {
        System.out.println("xx:" + (val & -val));
        return (val & -val) == val;
    }
}
